package com.pig4cloud.pig.demo.Controller;


import com.pig4cloud.pig.common.security.annotation.Inner;
import com.pig4cloud.pig.demo.Service.UserService;
import com.pig4cloud.pig.demo.feign.Entity.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user2")
@Inner
public class user2Controller {
    @Autowired
//    @Qualifier(value = "userServiceImpl")
    private UserService userService;


    //========================修改密码
    @GetMapping("updatePwd/{id}/{oldPwd}/{newPwd}")
    private UserInfo updatePwd2(@PathVariable(name="id")String id, @PathVariable(name="oldPwd")String oldPwd, @PathVariable(name="newPwd")String newPwd){
        System.out.println(id+":"+oldPwd+":"+newPwd);
        System.out.println("执行了修改密码");
        System.out.println(userService);
        UserInfo userInfo = userService.updatePwd(id, oldPwd, newPwd);
        return userInfo;
    }
}
